home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Dema / betonsoldier_spdemo.exe / {app} / Shaders / skin_mesh_shadow.fx < prev    next >
Encoding:
Text File  |  2005-05-05  |  3.6 KB  |  94 lines

  1. //------------------------------------------------------------------------------------------------------
  2. //------------------------------------------------------------------------------------------------------
  3. //------------------------------------------------------------------------------------------------------
  4.  
  5. //------------------------------------------------------------------------------------------------------
  6. //- Static parameters
  7. //------------------------------------------------------------------------------------------------------
  8.  
  9. //------------------------------------------------------------------------------------------------------
  10. //------------------------------------------------------------------------------------------------------
  11. //------------------------------------------------------------------------------------------------------
  12.  
  13. struct    CVertexShaderShadowInput
  14. {
  15.     float4    Position    :    POSITION;
  16.     float3    Weight        :    BLENDWEIGHT;
  17.     float4    BoneIndex    :    BLENDINDICES;
  18. };
  19.  
  20. //------------------------------------------------------------------------------------------------------
  21.  
  22. struct    CVertexShaderShadowOutput
  23. {
  24.     float4    Position    :    POSITION;
  25. };
  26.  
  27. //------------------------------------------------------------------------------------------------------
  28. //------------------------------------------------------------------------------------------------------
  29. //------------------------------------------------------------------------------------------------------
  30.  
  31. CVertexShaderShadowOutput    ShadowPass (const CVertexShaderShadowInput input);
  32.  
  33. //------------------------------------------------------------------------------------------------------
  34. //------------------------------------------------------------------------------------------------------
  35. //------------------------------------------------------------------------------------------------------
  36.  
  37. CVertexShaderShadowOutput    ShadowPass (const CVertexShaderShadowInput input)
  38. {
  39.     CVertexShaderShadowOutput    output;
  40.     CSkinningOutput                skinOutput;
  41.     
  42.     float3 fakeNormal = (0.0f,0.0f,0.0f);
  43.     float3 fakeBumpTangent = (0.0f,0.0f,0.0f);
  44.     float3 fakeBumpNormal = (0.0f,0.0f,0.0f);
  45.     
  46.     skinOutput = ComputeSkinning4Bones    (input.Position, fakeNormal, fakeBumpTangent, fakeBumpNormal, 
  47.                                          input.BoneIndex,input.Weight,BoneArray);
  48.     
  49.     output.Position = mul (skinOutput.SkinnedPosition,CameraProjection);
  50.         
  51.     return output;
  52. }
  53.  
  54. //------------------------------------------------------------------------------------------------------
  55. //------------------------------------------------------------------------------------------------------
  56. //------------------------------------------------------------------------------------------------------
  57.  
  58. technique    tech_shadow
  59. <
  60.     int Priority = 1;
  61.     int TechniqueIndex = 0;
  62.     int DeviceType = HWSHADER_ONLY;
  63.     int LightingType = INTEGRATED_LIGHTING;
  64.     string RenderingType = "Shadow";
  65. >
  66. {
  67.     pass pass1
  68.     {
  69.         CullMode            = CW;
  70.         ZEnable                = true;
  71.         ZFunc                = LESSEQUAL;
  72.         
  73.         ZWriteEnable        = true;
  74.         AlphaBlendEnable    = false;
  75.         AlphaTestEnable        = false;
  76.         FogEnable            = false;
  77.         
  78.         VertexShader = compile vs_1_1 ShadowPass();
  79.         
  80.         PixelShaderConstant[0]        = {0.0f,0.0f,0.0f,1.0f};
  81.         
  82.         PixelShader = 
  83.         asm
  84.         {
  85.             ps_1_1
  86.             
  87.             mov r0,c0
  88.         };
  89.     }
  90. }
  91.  
  92. //------------------------------------------------------------------------------------------------------
  93. //------------------------------------------------------------------------------------------------------
  94. //------------------------------------------------------------------------------------------------------